package com.lianwei.dao;


import com.lianwei.pojo.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface GoodsMapper {
       //查询
       List<Goods> getGoods();

       //id查询
       Goods getGoodsById(int id);

       //名称模糊查询
       List<Goods> getGoodsLike(String name);

       //类别查询
       List<Goods> getGoodsByCategoryId(int categotyid);

       //添加
       int addGoods(@Param("goods") Goods goods);

       //多行添加
       int addGoodsList(@Param("goodsList") List<Goods> goodsList);

       //更改
       int updateGoods(@Param("goods") Goods goods,int id);

       //删除
       int deleteGoodsById(int id);
}
